/*
 * @Author: your name
 * @Date: 2020-10-06 08:56:25
 * @LastEditTime: 2020-10-19 17:38:51
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \longh_web\src\apis\productProvide.js
 */
import request from '@/utils/request'

//获取ProductInfo详细信息和图片
export function getDetail(params) {
    return request({
        url: '/wenge/microservice-supply-consumer-web/productInfo/detail',
        method: 'POST',
        data: params
    })
}

//首页推荐
export function getRecommend(params) {
    return request({
        url: '/wenge/microservice-supply-consumer-web/productInfo/getOnlineRecommendation',
        method: 'POST',
        params
    })
}
//首页推荐随机版
export function getRandomOnlineRecommendationList(params) {
    return request({
        url: '/wenge/microservice-supply-consumer-web/productInfo/getRandomOnlineRecommendationList',
        method: 'POST',
        data:params
    })
}


//获取SearchProductInfo分页列表
export function getList(data) {
    return request({
        url: '/wenge/microservice-supply-consumer-web/productInfo/getSearchPageList',
        method: 'POST',
        data
    })
}

// 添加留言
export function addWords(data) {
    return request({
        url: '/wenge/microservice-supply-consumer-web/userMessage/add',
        method: 'POST',
        data
    })
}

//获取一级菜单
export function getProductOneCategory(params) {
    return request({
        url: '/wenge/microservice-supply-consumer-web/productCategory/getByParent',
        method: 'GET',
        params
    })
}

//首页统计
export function getTongJ(parameter) {
    return request({
        url: '/wenge/microservice-supply-consumer-web/productInfo/homeTj',
        method: 'POST',
        parameter
    })
}

//获取ProductInfo对象详情
export function getInfo(params) {
    return request({
        url: '/wenge/microservice-supply-consumer-web/productInfo/info',
        method: 'POST',
        params
    })
}

//添加关注
export function addAttention(params) {
    return request({
      url: "/wenge/microservice-supply-consumer-web/userAttention/add",
      method: "POST",
      data: params,
    })
  }

  //取消关注
export function updateAttention(params) {
    return request({
      url: "/wenge/microservice-supply-consumer-web/userAttention/update",
      method: "POST",
      data: params,
    })
  }


//相似产品
export function getSimilarList(params) {
 return request({
    url: "/wenge/microservice-supply-consumer-web/productInfo/getSimilarList",
    method: "POST",
    data: params,
 })
}
